package core

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"log"
)

/**
 * 入门
 */
func Run() {
	engine := gin.Default()

	engine.GET("/api", func(context *gin.Context) {
		fmt.Println("请求路径", context.FullPath())
		context.Writer.Write([]byte("hello"))
	})

	err := engine.Run(":9999")

	if err != nil {
		log.Fatalf(err.Error())
	}
}
